<?php

$text = $_GET["text"];
$id = $_GET["id"];


//连接
$servername = "localhost";
$username = "root";
$password = "root";
$db = "db5";
 
// 创建连接
$conn = new mysqli($servername, $username, $password,$db);
 
// 检测连接
if ($conn->connect_error) {
    die("连接失败: " . $conn->connect_error);
}

//更新语句
$sql = "UPDATE `user` SET `name` = '$text' WHERE `user`.`id` = $id;";
//执行sql
$conn->query($sql);

?>